package com.chen.serviceorder.controller;

import com.chen.internalcommon.dto.ResponseResult;
import com.chen.internalcommon.request.OrderRequest;
import com.chen.serviceorder.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author chenliuping
 * @since 2022-11-30
 */
@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    private OrderService orderService;

    @GetMapping("/test")
    public String test() {
        return orderService.test();
    }

    /**
     * 创建订单
     */
    @PostMapping("/add")
    public ResponseResult add(@RequestBody OrderRequest orderRequest) {
        return orderService.add(orderRequest);
    }



}
